package com.ybkj.chat.utils;

import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ybkj.chat.R;


public class HiddenUtils {
    /**
     * textView 展开于隐藏
     *
     * @param isShow
     * @return
     */
    public static boolean setVisible(ViewGroup viewGroup1, boolean isShow) {
        if (isShow) {
            viewGroup1.setVisibility(View.GONE);
            isShow = false;
        } else {
            viewGroup1.setVisibility(View.VISIBLE);
            isShow = true;
        }
        return isShow;
    }

    /**
     * TextView隐藏
     *
     * @param viewGroup1
     * @param satisfactionView
     * @param isShow
     * @return
     */
    public static boolean setGone(ViewGroup viewGroup1, TextView satisfactionView, boolean isShow) {
        viewGroup1.setVisibility(View.GONE);
        Drawable drawable = ResourcesUtil.getDrawable(R.mipmap.ic_more);
        drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
        satisfactionView.setCompoundDrawables(null, null, drawable, null);
        isShow = true;
        return isShow;
    }
}
